<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function canBeTypedWords(text, brokenLetters) {
      return text.split(' ').filter(_ => {
        for (let i of brokenLetters) if (_.includes(i)) return false
        return true
      }).length
    }
    console.log(canBeTypedWords("hello world", "ad"));
  </script>
</body>

</html>